package com.okami.reflex;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;

/**
 * @author: TanJingyu
 * @create: 2021-01-28 17:32
 **/
class MainTest {
    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        Class<PrivateConstructorClass> clazz = PrivateConstructorClass.class;
        Constructor<PrivateConstructorClass> constructor = clazz.getDeclaredConstructor();

        System.out.println(Modifier.isPublic(constructor.getModifiers()));
        System.out.println(Modifier.isPrivate(constructor.getModifiers()));

        System.out.println(Modifier.isPrivate(clazz.getModifiers()));
        System.out.println(Modifier.isPublic(clazz.getModifiers()));



//        constructor.setAccessible(true);
//        System.out.println(constructor.newInstance());



    }
}
